import user.AdminUser;
import user.ProxyUser;
import user.User;
import user.factory.AdminUserFactory;
import user.factory.IUserFactory;
import user.factory.NormalUserFactory;

public class LibrarySystem {
    public static void main(String[] args) {
        //工厂化创建对象
        IUserFactory adminUserFactory=new AdminUserFactory();
        User admin=adminUserFactory.createUser("刘备",1);

        IUserFactory normalUserFactory=new NormalUserFactory();
        User normal1=normalUserFactory.createUser("关羽",2);
        User normal2=normalUserFactory.createUser("张飞",3);

        //代理模式
        ProxyUser proxyUserAdmin=new ProxyUser(admin);
        ProxyUser proxyUserNormal1=new ProxyUser(normal1);
        ProxyUser proxyUserNormal2=new ProxyUser(normal2);
    }
}
